import Request from '../utils/request';

// 获取验证码
export function getSmsByPhone(_data: any) {
  return new Request().http({
    url: '/api/rwy/user/getSmsByPhone',
    data: _data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
  });
}

//验证码登录
export function smsLogin(_data: any) {
  return new Request().http({
    url: '/api/rwy/user/smsLogin',
    data: _data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
  });
}

//验证码登录
export function wxLogin(_data: any) {
  return new Request().http({
    url: '/api/v1/customer/weixin/login',
    data: _data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
  });
}

// 登录判断是否创建商户
export function whetherCreate() {
  return new Request().http({
    url: '/api/rwy/merchant/whetherCreate',
    data: {},
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
  });
}

// 查询地市列表
export function getCityOptions() {
  return new Request().http({
    url: '/api/rwy/merchant/city',
    data: {},
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
  });
}

// 新增商户
export function addMerchant(data) {
  return new Request().http({
    url: '/api/rwy/merchant/add',
    data: data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
    filter: true,
  });
}

// 新增品牌
export function addBrand(data) {
  return new Request().http({
    url: '/api/rwy/brand/add',
    data: data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
    filter: true,
  });
}

// 新增商铺
export function addShop(data) {
  return new Request().http({
    url: '/api/rwy/shop/add',
    data: data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
    filter: true,
  });
}

// 新增商铺
export function addGoods(data) {
  return new Request().http({
    url: '/api/rwy/goods/add',
    data: data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
    filter: true,
  });
}

// 新增卡券
export function addCoupon(data) {
  return new Request().http({
    url: '/api/rwy/coupon/add',
    data: data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
    filter: true,
  });
}

export function queryMerchantInfo() {
  return new Request().http({
    url: '/api/rwy/merchant/queryMerchantInfo',
    data: {},
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
  });
}

export function queryMerchant(data) {
  return new Request().http({
    url: '/api/rwy/merchant/queryMerchant',
    data: data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
    filter: true,
  });
}

// 根据商户查询所有品牌
export function queryAllBrand(data) {
  return new Request().http({
    url: '/api/rwy/brand/queryAll',
    data: data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
    filter: true,
  });
}

// 根据商户查询所有店铺
export function queryAllShop(data) {
  return new Request().http({
    url: '/api/rwy/shop/queryAll',
    data: data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
    filter: true,
  });
}

// 根据品牌 店铺 查询商品
export function queryGoodsById(data) {
  return new Request().http({
    url: '/api/rwy/goods/queryAll',
    data: data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
    filter: true,
  });
}

// 根据品牌 店铺 查询卡券
export function queryCouponById(data) {
  return new Request().http({
    url: '/api/rwy/coupon/queryCoupon',
    data: data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
    filter: true,
  });
}

// 根据品牌 店铺 查询卡券
export function queryMessage(data) {
  return new Request().http({
    url: '/api/rwy/message/queryAll',
    data: data,
    method: 'POST',
    header: {
      'Content-Type': 'application/json',
    },
    filter: true,
  });
}
